package com.taotao.thread.Test1;

import java.sql.Timestamp;
import java.util.concurrent.TimeUnit;

/**
 * @author wangjin
 * @title: T01_volatile
 * @projectName thread
 * @description: TODO
 * @date 2022/5/3 0003 16:33
 */
public class T01_volatile {
    boolean running_=true;
    void m(){
        System.out.println("m start");
        while (running_){

        }
        System.out.println("m end");
    }

    public static void main(String[] args) {
        T01_volatile t = new T01_volatile();
        new Thread(t::m,"t1").start();
        try {
            TimeUnit.MICROSECONDS.sleep(1);
        }catch (Exception e){
            e.getMessage();
        }
        t.running_=false;
    }
}
